import React ,{FC} from 'react'
import style from './QuestionCard.module.scss'
import { spawn } from 'child_process'


type propsType = {
    _id : string,
    title: string ,
    isStar: boolean,
    isPublished : boolean,
    answerCount : number,
    createAt : string
}

const QuestionCard : FC<propsType> =(props) => {
    const {_id , title , createAt , isStar , isPublished , answerCount} = props
  return (
    <>
      <div className={style.container}>
        <div className={style.title}>
            <div className={style.left}>
                <a href="#">{title}</a>
            </div>
            <div className={style.right}>
                <span>{isPublished ? <span style={{color : "green"}}>已发布</span> : <span>未发布</span>}</span>
                &nbsp;
                <span>答卷：{answerCount}</span>
                &nbsp;
                <span>{createAt}</span>
            </div>
        </div>
        <div className={style['button-container']}>
            <div className={style.left}>
                <button>编辑问卷</button>
                <button>编辑问卷</button>
            </div>
            <div className={style.right}>
                <button>标星</button>
                <button>复制</button>
                <button>删除</button>
            </div>
        </div>
      </div>
      
   </>
  )
}


export default QuestionCard